{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true,
    "pycharm": {
     "name": "#%% md\n"
    }
   },
   "source": [
    "# 使用Yelu-Walker方法计算AR(p)\n",
    "计算一个均值为0的离散随机时间序列$\\{X_i\\} ^ N$的AR(p)参数，怎么做？\n",
    "我们要估计的也就是下面公式中的$\\xi_{i+1}$\n",
    "\n",
    "$$\n",
    "x_{i+1}=\\phi_{1} x_{i}+\\phi_{2} x_{i-1}+\\cdots+\\phi_{p} x_{i-p+1}+\\xi_{i+1} \\tag 1\n",
    "$$\n",
    "\n",
    "# 1.转置\n",
    "\n",
    "## 1.1 p=1\n",
    "\n",
    "p=1的时候，公式变成这样$$X_{i+1} = \\phi_1 x_i  + \\epsilon_{i+1}$$\n",
    "上面的形式可以进一步写成这样：\n",
    "$$\n",
    "\\underbrace{\\left(\\begin{array}{c}\n",
    "x_{2} \\\\\n",
    "x_{3} \\\\\n",
    "\\vdots \\\\\n",
    "x_{N}\n",
    "\\end{array}\\right)}_{\\mathbf{b}}=\\underbrace{\\left(\\begin{array}{c}\n",
    "x_{1} \\\\\n",
    "x_{2} \\\\\n",
    "\\vdots \\\\\n",
    "x_{N-1}\n",
    "\\end{array}\\right)}_{\\mathbf{A}} \\phi_{1}\n",
    "$$\n",
    "\n",
    "可以使用最小二乘法求解：\n",
    "$$\n",
    "\\hat{\\phi}_{1}=\\left(\\mathbf{A}^{T} \\mathbf{A}\\right)^{-1} \\mathbf{A}^{T} \\mathbf{b}=\\frac{\\sum_{i=1}^{N-1} x_{i} x_{i+1}}{\\sum_{i=1}^{N-1} x_{i}^{2}}=\\frac{c_{1}}{c_{o}}=r_{1}\n",
    "$$\n",
    "上面的$c_{i}$、$r_{i}$分别是第i个自协方差和自协方差系数。\n",
    "\n",
    "## 1.2 p=2\n",
    "p=2的时候，公式变成这样$$X_{i+1} = \\phi_1 x_i  +\\phi_2 x_{i-1}  + \\epsilon_{i+1}$$\n",
    "上面的形式进一步写成这样：\n",
    "\n",
    "$$\n",
    "\\underbrace{\\left(\\begin{array}{c}\n",
    "x_{3} \\\\\n",
    "x_{4} \\\\\n",
    "\\vdots \\\\\n",
    "x_{N}\n",
    "\\end{array}\\right)}_{\\mathbf{b}}=\\underbrace{\\left(\\begin{array}{cc}\n",
    "x_{2} & x_{1} \\\\\n",
    "x_{3} & x_{2} \\\\\n",
    "\\vdots & \\vdots \\\\\n",
    "x_{N-1} & x_{N-2}\n",
    "\\end{array}\\right)}_{\\mathbf{A}} \\underbrace{\\left(\\begin{array}{c}\n",
    "\\phi_{1} \\\\\n",
    "\\phi_{2}\n",
    "\\end{array}\\right)}_{\\Phi} .\n",
    "$$\n",
    "\n",
    "和第一个不一样，这个时候上面的等式写成这样：\n",
    "$$\n",
    "\\hat{\\boldsymbol{\\Phi}}=\\left(\\mathbf{A}^{T} \\mathbf{A}\\right)^{-1} \\mathbf{A}^{T} \\mathbf{b}\n",
    "$$\n",
    "是这么计算的：\n",
    "$$\n",
    "\\begin{gathered}\n",
    "\\left(\\mathbf{A}^{T} \\mathbf{A}\\right)^{-1}=\\left[\\left(\\begin{array}{llll}\n",
    "x_{2} & x_{3} & \\cdots & x_{N-1} \\\\\n",
    "x_{1} & x_{2} & \\cdots & x_{N-2}\n",
    "\\end{array}\\right)\\left(\\begin{array}{cc}\n",
    "x_{2} & x_{1} \\\\\n",
    "x_{3} & x_{2} \\\\\n",
    "x_{N-1} & x_{N-2}\n",
    "\\end{array}\\right)\\right]^{-1} \\\\\n",
    "=\\left(\\begin{array}{cc}\n",
    "\\sum_{i=2}^{N-1} x_{i}^{2} & \\sum_{i=2}^{N-1} x_{i} x_{i-1} \\\\\n",
    "\\sum_{i=2}^{N-1} x_{i} x_{i-1} & \\sum_{i=1}^{N-2} x_{i}^{2}\n",
    "\\end{array}\\right)^{-1} \\\\\n",
    "=\\frac{1}{\\sum_{i=2}^{N-1} x_{i}^{2} \\sum_{i=1}^{N-2} x_{i}^{2}-\\sum_{i=2}^{N-1} x_{i} x_{i-1} \\sum_{i=2}^{N-1} x_{i} x_{i-1}}\\left(\\begin{array}{cc}\n",
    "\\sum_{i=1}^{N-2} x_{i}^{2} & -\\sum_{i=2}^{N-1} x_{i} x_{i-1} \\\\\n",
    "-\\sum_{i=2}^{N-1} x_{i} x_{i-1} & \\sum_{i=2}^{N-1} x_{i}^{2}\n",
    "\\end{array}\\right)\n",
    "\\end{gathered}\n",
    "$$\n",
    "\n",
    "接下来，假设时间序列是平稳的，所以说自协方差只和滞后多少项相关。利用这个性质，在这个案例里面可以得到这样的等式：\n",
    "\n",
    "$$\n",
    "\\begin{gathered}\n",
    "\\left(\\mathbf{A}^{T} \\mathbf{A}\\right)^{-1}=\\frac{1}{c_{o}^{2}-c_{1}^{2}}\\left(\\begin{array}{rr}\n",
    "c_{o} & -c_{1} \\\\\n",
    "-c_{1} & c_{o}\n",
    "\\end{array}\\right) \\\\\n",
    "\\left(\\mathbf{A}^{T} \\mathbf{A}\\right)^{-1}=\\frac{1}{c_{o}^{2}\\left(1-r_{1}^{2}\\right)}\\left(\\begin{array}{rr}\n",
    "c_{o} & -c_{1} \\\\\n",
    "-c_{1} & c_{o}\n",
    "\\end{array}\\right) \\\\\n",
    "\\left(\\mathbf{A}^{T} \\mathbf{A}\\right)^{-1}=\\frac{1}{c_{o}\\left(1-r_{1}^{2}\\right)}\\left(\\begin{array}{rr}\n",
    "r_{o} & -r_{1} \\\\\n",
    "-r_{1} & r_{o}\n",
    "\\end{array}\\right)\n",
    "\\end{gathered}\n",
    "$$\n",
    "而且：\n",
    "$$\n",
    "\\mathbf{A}^{T} \\mathbf{b}=\\left(\\begin{array}{llll}\n",
    "x_{2} & x_{3} & \\cdots & x_{N-1} \\\\\n",
    "x_{1} & x_{2} & \\cdots & x_{N-2}\n",
    "\\end{array}\\right)\\left(\\begin{array}{l}\n",
    "x_{3} \\\\\n",
    "x_{4} \\\\\n",
    "\\vdots \\\\\n",
    "x_{N}\n",
    "\\end{array}\\right)=\\left(\\begin{array}{l}\n",
    "\\sum_{i=3}^{N} x_{i} x_{i-1} \\\\\n",
    "\\sum_{i=3}^{N} x_{i} x_{i-2},\n",
    "\\end{array}\\right)\n",
    "$$\n",
    "\n",
    "又因为这个时间序列是平稳的，所以：\n",
    "\n",
    "$$\n",
    "\\mathbf{A}^{T} \\mathbf{b}=\\left(\\begin{array}{l}\n",
    "c_{1} \\\\\n",
    "c_{2}\n",
    "\\end{array}\\right)\n",
    "$$\n",
    "\n",
    "结合上面的公式，可以有：\n",
    "$$\n",
    "\\begin{gathered}\n",
    "\\left(\\mathbf{A}^{T} \\mathbf{A}\\right)^{-1} \\mathbf{A}^{T} \\mathbf{b}=\\frac{1}{c_{o}\\left(1-r_{1}^{2}\\right)}\\left(\\begin{array}{rr}\n",
    "r_{o} & -r_{1} \\\\\n",
    "-r_{1} & r_{o}\n",
    "\\end{array}\\right)\\left(\\begin{array}{l}\n",
    "c_{1} \\\\\n",
    "c_{2}\n",
    "\\end{array}\\right) \\\\\n",
    "=\\frac{1}{1-r_{1}^{2}}\\left(\\begin{array}{rr}\n",
    "1 & -r_{1} \\\\\n",
    "-r_{1} & 1\n",
    "\\end{array}\\right)\\left(\\begin{array}{l}\n",
    "r_{1} \\\\\n",
    "r_{2}\n",
    "\\end{array}\\right) .\n",
    "\\end{gathered}\n",
    "$$\n",
    "将上面的矩阵分为两个部分，可以得到：\n",
    "$$\n",
    "\\hat{\\phi}_{1}=\\frac{r_{1}\\left(1-r_{2}\\right)}{1-r_{1}^{2}}\n",
    "$$\n",
    "\n",
    "以及\n",
    "$$\n",
    "\\hat{\\phi}_{2}=\\frac{r_{2}-r_{1}^{2}}{1-r_{1}^{2}}\n",
    "$$\n",
    "\n",
    "虽然可以按照p=2继续计算p=3的情况，但是那样的话，代数计算会变得很复杂。\n",
    "幸运的是，有一种简单的方法来计算AR(p)的系数，这个方法就叫Yule-Waler公式。\n",
    "\n",
    "# 2. Yule-Waler公式\n",
    "\n",
    "这是一个AR(p)公式：\n",
    "$$\n",
    "x_{i+1}=\\phi_{1} x_{i}+\\phi_{2} x_{i-1}+\\cdots+\\phi_{p} x_{i-p+1}+\\xi_{i+1}\n",
    "$$\n",
    "\n",
    "## 2.1 lag=1（滞后1）\n",
    "\n",
    "在左右两边乘上$x_{i}$，得\n",
    "$$\n",
    "x_{i} x_{i+1}=\\sum_{j=1}^{p}\\left(\\phi_{j} x_{i} x_{i-j+1}\\right)+x_{i} \\xi_{i+1}\n",
    "$$\n",
    "\n",
    "i和j是各自的时间索引。把$\\{\\phi_j\\}$都拎出来，$x_j$都写到一起，得到这样的公式：\n",
    "$$\n",
    "\\left\\langle x_{i} x_{i+1}\\right\\rangle=\\sum_{j=1}^{p}\\left(\\phi_{j}\\left\\langle x_{i} x_{i-j+1}\\right\\rangle\\right)+\\left\\langle x_{i} \\xi_{i+1}\\right\\rangle\n",
    "$$\n",
    "\n",
    "注意到$\\left\\langle x_{i} \\xi_{i+1}\\right\\rangle = 0$ 因为截距$\\xi$和当前时间是无关的，因此：\n",
    "$$\n",
    "\\left\\langle x_{i} x_{i+1}\\right\\rangle=\\sum_{j=1}^{p}\\left(\\phi_{j}\\left\\langle x_{i} x_{i-j+1}\\right\\rangle\\right)\n",
    "$$\n",
    "\n",
    "再除以N-1，再利用自协方差的平衡性:$c_{-l} = c_{l}$，得：\n",
    "$$\n",
    "c_{1}=\\sum_{j=1}^{p} \\phi_{j} c_{j-1}\n",
    "$$\n",
    "\n",
    "再除以$c_0$，得：\n",
    "$$\n",
    "r_{1}=\\sum_{j=1}^{p} \\phi_{j} r_{j-1}\n",
    "$$\n",
    "\n",
    "\n",
    "## 2.2 lag=2（滞后2）\n",
    "\n",
    "两边乘以$x_{i-1}$, 得到：\n",
    "\n",
    "$$\n",
    "x_{i-1} x_{i+1}=\\sum_{j=1}^{p}\\left(\\phi_{j} x_{i-1} x_{i-j+1}\\right)+x_{i-1} \\xi_{i+1}\n",
    "$$\n",
    "\n",
    "然后：\n",
    "$$\n",
    "\\left\\langle x_{i-1} x_{i+1}\\right\\rangle=\\sum_{j=1}^{p}\\left(\\phi_{j}\\left\\langle x_{i-1} x_{i-j+1}\\right\\rangle\\right)+\\left\\langle x_{i-1} \\xi_{i+1}\\right\\rangle\n",
    "$$\n",
    "\n",
    "然后：\n",
    "$$\n",
    "\\left\\langle x_{i-1} x_{i+1}\\right\\rangle=\\sum_{j=1}^{p}\\left(\\phi_{j}\\left\\langle x_{i-1} x_{i-j+1}\\right\\rangle\\right)\n",
    "$$\n",
    "\n",
    "然后：\n",
    "$$\n",
    "c_{2}=\\sum_{j=1}^{p} \\phi_{j} c_{j-2}\n",
    "$$\n",
    "\n",
    "然后：\n",
    "$$\n",
    "r_{2}=\\sum_{j=1}^{p} \\phi_{j} r_{j-2}\n",
    "$$\n",
    "\n",
    "\n",
    "## 2.3 lag=k(滞后k)\n",
    "\n",
    "两边乘以$x_{i-k-1}$, 得到：\n",
    "\n",
    "$$\n",
    "x_{i-k+1} x_{i+1}=\\sum_{j=1}^{p}\\left(\\phi_{j} x_{i-k+1} x_{i-j+1}\\right)+x_{i-k+1} \\xi_{i+1}\n",
    "$$\n",
    "\n",
    "然后：\n",
    "$$\n",
    "\\left\\langle x_{i-k+1} x_{i+1}\\right\\rangle=\\sum_{j=1}^{p}\\left(\\phi_{j}\\left\\langle x_{i-k+1} x_{i-j+1}\\right\\rangle\\right)+\\left\\langle x_{i-k+1} \\xi_{i+1}\\right\\rangle\n",
    "$$\n",
    "\n",
    "然后：\n",
    "$$\n",
    "\\left\\langle x_{i-k+1} x_{i+1}\\right\\rangle=\\sum_{j=1}^{p}\\left(\\phi_{j}\\left\\langle x_{i-k+1} x_{i-j+1}\\right\\rangle\\right)\n",
    "$$\n",
    "\n",
    "然后：\n",
    "$$\n",
    "c_{k}=\\sum_{j=1}^{p} \\phi_{j} c_{j-k}\n",
    "$$\n",
    "\n",
    "然后：\n",
    "$$\n",
    "r_{k}=\\sum_{j=1}^{p} \\phi_{j} r_{j-k}\n",
    "$$\n",
    "\n",
    "\n",
    "\n",
    "## 2.4 lag=p(滞后p)\n",
    "\n",
    "两边乘以$x_{i-p-1}$, 得到：\n",
    "\n",
    "$$\n",
    "x_{i-p+1} x_{i+1}=\\sum_{j=1}^{p}\\left(\\phi_{j} x_{i-p+1} x_{i-j+1}\\right)+x_{i-p+1} \\xi_{i+1}\n",
    "$$\n",
    "\n",
    "然后：\n",
    "$$\n",
    "\\left\\langle x_{i-p+1} x_{i+1}\\right\\rangle=\\sum_{j=1}^{p}\\left(\\phi_{j}\\left\\langle x_{i-p+1} x_{i-j+1}\\right\\rangle\\right)+\\left\\langle x_{i-p+1} \\xi_{i+1}\\right\\rangle\n",
    "$$\n",
    "\n",
    "然后：\n",
    "$$\n",
    "\\left\\langle x_{i-p+1} x_{i+1}\\right\\rangle=\\sum_{j=1}^{p}\\left(\\phi_{j}\\left\\langle x_{i-p+1} x_{i-j+1}\\right\\rangle\\right)\n",
    "$$\n",
    "\n",
    "然后：\n",
    "$$\n",
    "c_{p}=\\sum_{j=1}^{p} \\phi_{j} c_{j-p}\n",
    "$$\n",
    "\n",
    "然后：\n",
    "$$\n",
    "r_{p}=\\sum_{j=1}^{p} \\phi_{j} r_{j-p}\n",
    "$$\n",
    "\n",
    "\n",
    "## 2.5 将上面的公式放一起\n",
    "\n",
    "有：\n",
    "$$\n",
    "\\begin{gathered}\n",
    "r_{1}=\\phi_{1} r_{o}+\\phi_{2} r_{1}+\\phi_{3} r_{2}+\\cdots+\\phi_{p-1} r_{p-2}+\\phi_{p} r_{p-1} \\\\\n",
    "r_{2}=\\phi_{1} r_{1}+\\phi_{2} r_{o}+\\phi_{3} r_{1}+\\cdots+\\phi_{p-1} r_{p-3}+\\phi_{p} r_{p-2} \\\\\n",
    "\\vdots \\\\\n",
    "r_{p-1}=\\phi_{1} r_{p-2}+\\phi_{2} r_{p-3}+\\phi_{3} r_{p-4}+\\cdots+\\phi_{p-1} r_{o}+\\phi_{p} r_{1} \\\\\n",
    "r_{p}=\\phi_{1} r_{p-1}+\\phi_{2} r_{p-2}+\\phi_{3} r_{p-3}+\\cdots+\\phi_{p-1} r_{1}+\\phi_{p} r_{o}\n",
    "\\end{gathered}\n",
    "$$\n",
    "可以被写成：\n",
    "$$\n",
    "\\left(\\begin{array}{c}\n",
    "r_{1} \\\\\n",
    "r_{2} \\\\\n",
    "\\vdots \\\\\n",
    "r_{p-1} \\\\\n",
    "r_{p}\n",
    "\\end{array}\\right)=\\left(\\begin{array}{cccccc}\n",
    "r_{o} & r_{1} & r_{2} & \\cdots & r_{p-2} & r_{p-1} \\\\\n",
    "r_{1} & r_{o} & r_{1} & \\cdots & r_{p-3} & r_{p-2} \\\\\n",
    "& \\vdots & & & \\vdots & \\\\\n",
    "r_{p-2} & r_{p-3} & r_{p-4} & \\cdots & r_{o} & r_{1} \\\\\n",
    "r_{p-1} & r_{p-2} & r_{p-3} & \\cdots & r_{1} & r_{o}\n",
    "\\end{array}\\right)\\left(\\begin{array}{c}\n",
    "\\phi_{1} \\\\\n",
    "\\phi_{2} \\\\\n",
    "\\vdots \\\\\n",
    "\\phi_{p-1} \\\\\n",
    "\\phi_{p}\n",
    "\\end{array}\\right)\n",
    "$$\n",
    "\n",
    "又因为$r_0 = 1$，所以可以写成：\n",
    "$$\n",
    "\\underbrace{\\left(\\begin{array}{c}\n",
    "r_{1} \\\\\n",
    "r_{2} \\\\\n",
    "\\vdots \\\\\n",
    "r_{p-1} \\\\\n",
    "r_{p}\n",
    "\\end{array}\\right)}_{\\mathbf{r}} \\underbrace{\\left(\\begin{array}{cccccc}\n",
    "1 & r_{1} & r_{2} & \\cdots & r_{p-2} & r_{p-1} \\\\\n",
    "r_{1} & 1 & r_{1} & \\cdots & r_{p-3} & r_{p-2} \\\\\n",
    "& \\vdots & & & \\vdots & \\\\\n",
    "r_{p-2} & r_{p-3} & r_{p-4} & \\cdots & 1 & r_{1} \\\\\n",
    "r_{p-1} & r_{p-2} & r_{p-3} & \\cdots & r_{1} & 1\n",
    "\\end{array}\\right)}_{\\mathbf{R}} \\underbrace{\\left(\\begin{array}{c}\n",
    "\\phi_{1} \\\\\n",
    "\\phi_{2} \\\\\n",
    "\\vdots \\\\\n",
    "\\phi_{p-1} \\\\\n",
    "\\phi_{p}\n",
    "\\end{array}\\right)}_{\\boldsymbol{\\Phi}}\n",
    "$$\n",
    "整理成：\n",
    "$$\n",
    "\\mathbf{R} \\boldsymbol{\\Phi}=\\mathbf{r} \\tag 2\n",
    "$$\n",
    "\n",
    "最终可以写成这样\n",
    "$$\n",
    "\\hat{\\boldsymbol{\\Phi}}=\\mathbf{R}^{-1} \\mathbf{r}\n",
    "$$\n",
    "\n",
    "# 3. Yule-Walker公式求解过程\n",
    "\n",
    "- 循环i，$1 \\leq i \\leq p$\n",
    "\n",
    "  - 计算$\\mathbf{R} ^ {(i)}$ 和 $\\mathbf{r} ^ {(i)}$\n",
    "  - 然后计算$\\hat{\\boldsymbol{\\Phi}}^{(i)}$，公式为：\n",
    "$\n",
    "\\hat{\\boldsymbol{\\Phi}}^{(i)}=\\left(\\mathbf{R}^{(i)}\\right)^{-1} \\mathbf{r}^{(i)}=\\left(\\begin{array}{c}\n",
    "\\hat{\\phi}_{1} \\\\\n",
    "\\hat{\\phi}_{2} \\\\\n",
    "\\vdots \\\\\n",
    "\\hat{\\phi}_{i}\n",
    "\\end{array}\\right)\n",
    "$\n",
    "  - 只保留$\\hat{\\phi}_{i}$，在$1 \\leq j \\leq {i-1}$范围内的$\\hat{\\phi}_{j}$都不要。\n",
    "  - 第i个pacf系数这个时候就等于$pacf(i) = \\hat{\\phi}_{i}$\n",
    "\n",
    "- 结束循环i。\n",
    "\n",
    "\n",
    "# 4. python计算Yule-Walker公式\n",
    "\n",
    "\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "outputs": [
    {
     "data": {
      "text/plain": "array([ 1.        , -0.09547168, -0.38853085,  0.24985203,  0.24707613,\n        0.26419663])"
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from scipy.linalg import toeplitz\n",
    "import numpy as np\n",
    "\n",
    "\n",
    "def cal_my_yule_walker(x, nlags=5):\n",
    "    \"\"\"\n",
    "    自己实现yule_walker理论\n",
    "    :param x:\n",
    "    :param nlags:\n",
    "    :return:\n",
    "    \"\"\"\n",
    "    x = np.array(x, dtype=np.float64)\n",
    "    x -= x.mean()\n",
    "    n = x.shape[0]\n",
    "\n",
    "    r = np.zeros(shape=nlags+1, dtype=np.float64)\n",
    "    r[0] = (x ** 2).sum()/n\n",
    "\n",
    "    for k in range(1, nlags+1):\n",
    "        r[k] = (x[0:-k] * x[k:]).sum() / (n-k*1)\n",
    "\n",
    "\n",
    "    R = toeplitz(c=r[:-1])\n",
    "    result = np.linalg.solve(R, r[1:])\n",
    "    return result\n",
    "\n",
    "def cal_my_pacf_yw(x, nlags=5):\n",
    "    \"\"\"\n",
    "    自己通过yule_walker方法求出pacf的值\n",
    "    :param x:\n",
    "    :param nlags:\n",
    "    :return:\n",
    "    \"\"\"\n",
    "    pacf = np.empty(nlags+1) * 0\n",
    "    pacf[0] = 1.0\n",
    "    for k in range(1, nlags+1):\n",
    "        pacf[k] = cal_my_yule_walker(x,nlags=k)[-1]\n",
    "\n",
    "    return pacf\n",
    "\n",
    "\n",
    "# 测试函数\n",
    "data_x = np.random.randint(low=10, high=20, size=20)\n",
    "\n",
    "# 使用yelu_walker方法计算pacf\n",
    "cal_my_pacf_yw(data_x)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}